package com.antovita.militarymonkey.screens;

import java.util.List;

import com.antovita.militarymonkey.MyGdxGame;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;

public class ScoresMenuScreen extends ChoiceMenuScreen {

	private BitmapFont font;
	private List<Integer> scores;
	private float interval;
	private float height;

	public ScoresMenuScreen(MyGdxGame gdxGame) {
		super(gdxGame);
	}

	@Override
	public void create() {
		font = new BitmapFont(Gdx.files.internal("data/forte.fnt"),
				Gdx.files.internal("data/forte.png"), false);
		font.setColor(0.075f, 0.722f, 0.412f, 1); // 19 184 105
		interval = HEIGHT / 15f;
		height = HEIGHT - 2 * interval;
	}

	@Override
	public void render() {
		super.render();
		batch.begin();
		
		for (int i = 0; i < scores.size() && i < 10; i++) {
			font.draw(batch, i + 1 + ". " + scores.get(i),
					WIDTH * 0.35f, height - i * interval);
		}
		batch.end();
	}

	public void setScores(List<Integer> scores) {
		this.scores = scores;
	}

}
